﻿<%@ Page Language="C#" MasterPageFile="~/companypart/CompanyMastermaster.master" AutoEventWireup="true" CodeFile="CompanyNotifications.aspx.cs" Inherits="companypart_CompanyNotifications" Title="Untitled Page" meta:resourcekey="PageResource1"%>
<%@ Register Assembly="AjaxControlToolkit" Namespace="AjaxControlToolkit" TagPrefix="asp" %>

<asp:Content ID="Content1" ContentPlaceHolderID="head" Runat="Server">
    <title>التنبيهات</title>
 <style type="text/css">
/*Hover Menu*/
 tr .tabbone4{
	 background-color:#028ac5;
	 font-size:11px;
	 line-height:20px;
	 font-family:Tahoma;
  	 color:#fff;
  	 text-align:right;
	
}
.adel4{
	background-color:#ededed;
	font-size:10px;
	color:#084f86;
	font-family:Tahoma;
	height:30px;
	text-align:  right;
}
         .zr3 {
	background-image:url('../images/button2.png');
	display:block;
	float:right;
	 padding: 0px 10px 0px 10px;
	height:21px;
	text-align:center;
	color:#fff;
	text-shadow:1px 1px 0px #003a5e;
	margin-right:2px;
	line-height:19px;
	font-weight:bold;
	text-decoration:none;
	font-family:Tahoma;
	font-size:12px;


}
.zr3:hover ,.zr3:active {
	background-image:url('../images/button2.png');
	text-shadow:1px 1px 0px #003a5e;
	background-position:0px -21px;
	
}
  .stylelabel3
       {
       	color:#064c66;
	 font-weight:bold;
	 direction:rtl;
	 text-align:right;
       	}
             .tab3{
	width:815px;
 direction:rtl;
 border:1px #ccc solid;
 border-radius:5px;
 }

tr .tabbone3{
	 background-color:#028ac5;
	 font-size:11px;
	 line-height:20px;
	 font-family:Tahoma;
  	 color:#fff;
  	 text-align:center;
	
}
 .req3
       {
           color:Red;
       } 
.adel3{
	background-color:#ededed;
	font-size:10px;
	color:#084f86;
	font-family:Tahoma;
	height:30px;
	text-align:  center;
}
.he3{
	background-color:#fff;
	padding:5px;
	font-family:Tahoma;
	font-size:14px;
	font-weight:bold;
}
.txt3
{
    border:1px solid black;
    }
        .jqmWindow {
    display: none;
    
    position: fixed;
    top: 17%;
    left: 50%;
    
    margin-left: -300px;
    width: 800px;
    
    background-color: #EEE;
    color: #333;
    border: 1px solid black;
    padding: 12px;
}

     /*Hover Menu*/
.popupMenu {
	position:absolute;
	visibility:hidden;
	background-color:#F5F7F8;
	opacity:.9;
	filter: alpha(opacity=90);
}

.popupHover {
	background-image:url(icons/header-opened.png);
	background-repeat:repeat-x;
	background-position:left top;
	background-color:#F5F7F8;
}

/*Popup Control*/
.popupControl{
	background-color:White;
	position:absolute;
	visibility:hidden;
	margin-top:5px;
}

.ContextMenuBreak
{
	margin:1px 1px 1px 32px;
	padding:0;
	height:1px;
	overflow:hidden;
	display:block;
	border-top: 1px solid #C5C5C5;	
}

a.ContextMenuItem
{
	margin: 1px 0 1px 0;
	display: block;
	color: #003399;
	text-decoration: none;
	cursor: pointer;	
	padding: 4px 33px 4px 33px;
	white-space: nowrap;
}

a.ContextMenuItem-Selected
{
	font-weight: bold;
}

a.ContextMenuItem:hover
{
	background-color: #FFE6A0;
	color: #003399;
	border: 1px solid #D2B47A;
	padding: 3px 32px 3px 32px;
}
</style>
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="ContentPlaceHolder1" Runat="Server">
    <table    dir="rtl">
     <tr dir="ltr">
       <td>
         <br />
        <asp:ImageButton ID="mailsnot" runat="server" ImageUrl="~/icons/mails.png" Height="25px"
                        OnClick="mailsnot_Click" Width="29px" />
  
        <asp:HoverMenuExtender ID="hme2" runat="Server" HoverCssClass="popupHover" PopupControlID="PopupMenu"
            PopupPosition="Bottom" TargetControlID="mailsnot" PopDelay="25" />
                      
                        
       
         <asp:Label  CssClass="stylelabel3" ID="newmail" runat="server" Text="لديك رسائل من النظام" meta:resourceKey="newmail"></asp:Label>
                      
                        
       
      </td>
  
      
      </tr>
      <tr>
<td >   
          <asp:GridView ID="GridView1" runat="server" AutoGenerateColumns="False"
                    DataSourceID="SqlDataSource2" 
                     OnRowCreated="GridView1_RowCreated"
                    AllowPaging="True" EnableModelValidation="True" GridLines="None"  >
                    <PagerSettings FirstPageText="الاولى" LastPageText="الاخيرة"
                        NextPageText="التالى" PreviousPageText="السابق" />
                    <Columns>
                        <asp:TemplateField>
                            <HeaderTemplate>
                                
                                    <table class="tab3">
                                    <tr class="he3">
                                    <td align="right" colspan="5">
                                     <asp:ImageButton ID="ImageButton1" PostBackUrl="#" runat="server" ImageUrl="~/icons/not.png" 
             Height="20px" Width="30px" />
    
         <asp:Label  ID="upsub" runat="server" 
             Text="يرجى متابعة هذة الاشتراكات" meta:resourceKey="upsub" >
             </asp:Label>
                                    </td>
                                    </tr>
                                        <tr class="tabbone3"> 
                                        
                                        <td style="width:200px" >
                                                <asp:Label ID="Label5" runat="server" Text="المنتج" meta:resourceKey="lblsupposeddate"
                                                    />
                                            </td>
                                            <td style="width:200px" >
                                                <asp:Label ID="lblpadfees" runat="server" Text="ميعاد الاستلام " meta:resourceKey="lblsupposeddate"
                                                    />
                                            </td>
                                           
                                            <td style="width:200px">
                                                   <asp:Label ID="Label1" runat="server" Text="قيمة النسخة" meta:resourceKey="lblpaidfees"
                                                    />
                                            </td>
                                            <td style="width:75px">
                                                <asp:Label ID="lblissn" runat="server" Text="عدد النسخ " meta:resourceKey="lblcopyno"
                                                    />
                                            </td>
                                            <td style="width:75px">
                                             <asp:Label ID="lblfollow" runat="server" Text="متابعة" meta:resourceKey="lblcopyno"
                                                    />
                                            </td>
                                        </tr>
                                    </table>
                               
                            </HeaderTemplate>
                            <ItemTemplate>
                                <table class="tab3">
                                    <tr class="adel3">
                                          <td style="width:200px">
                                            <asp:Label  ID="product" runat="server" Text='<%# HttpUtility.HtmlEncode(Convert.ToString(Eval("product"))) %>'
                                                 />
                                                </td>
                                        <td style="width:200px">
                                            <asp:Label  ID="issuedate" runat="server" Text='<%# HttpUtility.HtmlEncode(Convert.ToString(Eval("issuedate"))) %>'
                                                 />
                                        </td>
                                        
                                        <td style="width:200px">
                                            <asp:Label  ID="Label12" runat="server" Text='<%# HttpUtility.HtmlEncode(Convert.ToString(Eval("copyprice"))) %>'
                                                 />
                                        </td>
                                        <td style="width:75px">
                                            <asp:Label  ID="Label13" runat="server" Text='<%# HttpUtility.HtmlEncode(Convert.ToString(Eval("copyno"))) %>'
                                                />
                                        </td>
                                      <td style="width:75px">
                                      <asp:HyperLink ID="follow"  runat="server" meta:resourceKey="lblshow" NavigateUrl='<%# this.ResolveUrl("~/" + string.Format("companypart/CompanyFollowup.aspx?check_id={0}",Eval("mysub"))) %>' ></asp:HyperLink>
                                      </td>
                                    </tr>
                                </table>
                            </ItemTemplate>
                        </asp:TemplateField>
                   
                    </Columns>
                </asp:GridView>
    <asp:SqlDataSource ID="SqlDataSource2" runat="server" 
        ConnectionString="<%$ ConnectionStrings:ConnectionString %>" 
        
              
              SelectCommand="select d.*,t.*,p.product ,d.id as mysub  from daily_checking d   INNER JOIN company_product t ON (d.company_product_id = t.id) INNER JOIN products p ON (t.product_id = p.id)  WHERE  t.company_id= @myssub and checked=0  and d.issuedate<=getdate()">
        <SelectParameters>
            <asp:SessionParameter Name="myssub" SessionField="company_id" />
        </SelectParameters>
       
    </asp:SqlDataSource>
                
   </td>
      
      </tr>
      </table>
    
      <table    dir="rtl">
     <tr dir="rtl">
     <td>
     
          <br />
         
    
      </td>
      </tr>
      <tr>
<td colspan="2" > 
      <asp:GridView ID="GridView2" runat="server" AutoGenerateColumns="False"
                    DataSourceID="SqlDataSource1" 
                    OnRowCreated="GridView1_RowCreated"
                    AllowPaging="True" EnableModelValidation="True" 
          GridLines="None"  >
                    <PagerSettings FirstPageText="الاولى" LastPageText="الاخيرة"
                        NextPageText="التالى" PreviousPageText="السابق" />
                    <Columns>
                        <asp:TemplateField>
                            <HeaderTemplate>
                                
                                    <table class="tab3">
                                    <tr class="he3">
                                    <td colspan="4" align="right">
                                    <asp:ImageButton ID="ImageButton2" PostBackUrl="#"  runat="server" ImageUrl="~/icons/not.png" 
             Height="20px" Width="31px" />
    
         <asp:Label  ID="Label2" runat="server" 
             Text="الاشتراكات القادم متابعتها" meta:resourceKey="lblstartofsubs" 
             ></asp:Label>
                                    </td>
                                    </tr>
                                        <tr class="tabbone3">
                                            <td style="width:200px">
                                                <asp:Label ID="Label4" runat="server" Text="المنتج " meta:resourceKey="lblsatrtsub"
                                                    />
                                            </td>
                                            <td style="width:200px">
                                                <asp:Label ID="lblpadfees" runat="server" Text="ميعاد الاستلام " meta:resourceKey="lblsupposeddate"
                                                    />
                                            </td>
                                            
                                            <td style="width:75px">
                                                   <asp:Label ID="Label1" runat="server" Text="قيمة النسخة" meta:resourceKey="lblpaidfees"
                                                     />
                                            </td>
                                            <td style="width:75px">
                                                <asp:Label ID="lblissn" runat="server" Text="عدد النسخ " meta:resourceKey="lblcopyno"
                                                     />
                                            </td>
                                          
                                        </tr>
                                    </table>
                              
                            </HeaderTemplate>
                            <ItemTemplate>
                                <table class="tab3">
                                    <tr class="adel3">
                                         <td style="width:200px">
                                            <asp:Label  ID="product" runat="server" Text='<%# HttpUtility.HtmlEncode(Convert.ToString(Eval("product"))) %>'
                                                 />
                                        </td>
                                        <td style="width:200px">
                                            <asp:Label  ID="issuedate" runat="server" Text='<%# HttpUtility.HtmlEncode(Convert.ToString(Eval("issuedate"))) %>'
                                                 />
                                        </td>
                                        
                                        <td style="width:75px">
                                            <asp:Label  ID="Label12" runat="server" Text='<%# HttpUtility.HtmlEncode(Convert.ToString(Eval("copyprice"))) %>'
                                                />
                                        </td>
                                        <td style="width:75px">
                                            <asp:Label  ID="Label13" runat="server" Text='<%# HttpUtility.HtmlEncode(Convert.ToString(Eval("copyno"))) %>'
                                                 />
                                        </td>
                                      
                                    </tr>
                                </table>
                            </ItemTemplate>
                        </asp:TemplateField>
                    </Columns>
                </asp:GridView>
    <asp:SqlDataSource ID="SqlDataSource1" runat="server" 
        ConnectionString="<%$ ConnectionStrings:ConnectionString %>" 
        
              
              SelectCommand="select d.*,t.*,p.product ,d.id as mysub  from daily_checking d   INNER JOIN company_product t ON (d.company_product_id = t.id) INNER JOIN products p ON (t.product_id = p.id)  WHERE  t.company_id= @myssub and checked=0  and d.issuedate between getdate() and getdate()+7">
        <SelectParameters>
            <asp:SessionParameter Name="myssub" SessionField="company_id" />
        </SelectParameters>
       
    </asp:SqlDataSource>
    </td>
    </tr>
    </table>
    <br />
    <asp:Panel CssClass="popupControl" ID="PopupMenu" runat="server">
            <div>
             
                <asp:Repeater ID="notificationsRepeater" runat="server">
                <SeparatorTemplate>
          
                </SeparatorTemplate>
                <ItemTemplate>
                     <table bgcolor="Transparent" style="border: solid 1px black;">
                        <tr>
                            <td>      
                            <asp:HyperLink runat="server" Width="200px" ID="Options" Text='<%# DataBinder.Eval(Container.DataItem, "title")%>'
                                    CssClass="ContextMenuItem" NavigateUrl='<%# this.ResolveUrl("~/companypart/" + string.Format("SendmsgAdmin.aspx")) %>' />
                            </td>
                            <td>
                                   <img src="../icons/season2.png" alt="" width="25" height="25" />
                         </td>
                        </tr>
                    </table>
                    
                </ItemTemplate>
            </asp:Repeater>
                
                
                </div>
        </asp:Panel>
</asp:Content>

